Mod Name / Version: Randon Tips for IIP <br /><br />
Description: Not sure this is really a "Mod" but I use IIP 6.5 and made one of my custom PAL boxes into a "Random Tip" generator. Each time a user hits the Entrance Page, that box pulls a random "forum tip" from a DB table and displays it. [Moderator, if this is not appropriate here, please delete]<br />Can bee seen at
www.Britishcarforum.com<br /><br />NOTE: I happen to use this for random forum tips (how to do things on the forum) but it could be used to display any random text you want.<br /><br /> <br /><br />
Working Under: UBB.Threads 6.5 <br /><br />
Mod Status: Beta <br /><br />
Any pre-requisites: Threads 6.5 and IIP 6.5 (Probably would work with other versions) <br /><br />
Author(s): Basil <br /><br />
Date: 10/05/04 <br /><br />
Credits: Obviously David Lozier for the great IIP Mod and others who have improved on it <br /><br />
Files Altered: Custombox8pal.php (or any custom PAL box) <br /><br />
New Files: None <br /><br />
Database Altered: Threads <br /><br />
Info/Instructions: Add a Table w3t_IIPrandomtip to the threads data base. The table just needs two fields:<br /><br />tipnumber, type=int autoindex<br />tiptext, type=text<br /><br />Just add a row for each random tip (or whatever) you want. The text in the tiptext field can contain standard HTML code.<br /><br />Then just modify one of your custom PAL box files like so:<br /><br />
<br />// MODE BY BASIL TO MAKE CONTENT RANDOM:<br /><br /> $query = "SELECT * FROM w3t_IIPrandomtip";<br /> $result = mysql_query($query);<br /> $num_results = mysql_num_rows($result);<br /> $tipnumber=rand(1,$num_results);<br /><br /> // Get the random tip text<br /> $query = "SELECT * FROM w3t_IIPrandomtip WHERE tipnumber = $tipnumber";<br /> $result = mysql_query($query);<br /> $row = mysql_fetch_row($result);<br /> $tip = $row[1];<br /> <br /> echo "$tbopen<tr><td align=\"left\" class=\"tdheader\">"; // Table Start<br /> <br /> echo "Random Forum Tip #".$tipnumber; // Table Heading<br /> <br /> echo "</td></tr><tr><td align=\"left\" valign=\"top\" class=\"lighttable\">"; // Close Header and Open Content<br /><br /> echo $tip;<br /><br /> echo "</td></tr>$tbclose<br />"; // Close Content and End Table<br />
<br /><br /> <br /><br />
Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.